<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>IVFileDownloader Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">IoTVideo </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">tencentcs</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/fileName">fileName</option>
		
		<option value="//api/name/fileSize">fileSize</option>
		
		<option value="//api/name/fileTime">fileTime</option>
		
		<option value="//api/name/rcvSize">rcvSize</option>
		
		<option value="//api/name/status">status</option>
		
	</optgroup>
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/downloadPlaybackFile:offset:ready:progress:paused:success:failure:">- downloadPlaybackFile:offset:ready:progress:paused:success:failure:</option>
		
		<option value="//api/name/initWithDeviceId:">- initWithDeviceId:</option>
		
		<option value="//api/name/initWithDeviceId:sourceId:">- initWithDeviceId:sourceId:</option>
		
		<option value="//api/name/pause">- pause</option>
		
		<option value="//api/name/stop">- stop</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">IVFileDownloader Class Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Inherits from</th>
	<td><a href="../Classes/IVConnection.html">IVConnection</a> : NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>IVFileDownloader.h</td>
</tr>
						</tbody></table></div>
					

                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>文件下载器</p>
					</div>
					
					

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/initWithDeviceId:" title="initWithDeviceId:"></a>
	<h3 class="method-title"><code><a href="#//api/name/initWithDeviceId:">&ndash;&nbsp;initWithDeviceId:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>创建文件下载器</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (nullable instancetype)initWithDeviceId:(NSString *)<em>deviceId</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>deviceId</code></th>
						<td><p>设备ID</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/initWithDeviceId:sourceId:" title="initWithDeviceId:sourceId:"></a>
	<h3 class="method-title"><code><a href="#//api/name/initWithDeviceId:sourceId:">&ndash;&nbsp;initWithDeviceId:sourceId:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>创建文件下载器</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (nullable instancetype)initWithDeviceId:(NSString *)<em>deviceId</em> sourceId:(uint16_t)<em>sourceId</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>deviceId</code></th>
						<td><p>设备ID</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>sourceId</code></th>
						<td><p>源ID，默认为0</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/status" title="status"></a>
	<h3 class="method-title"><code><a href="#//api/name/status">&nbsp;&nbsp;status</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>下载器状态</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) IVDownloaderStatus status</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/fileName" title="fileName"></a>
	<h3 class="method-title"><code><a href="#//api/name/fileName">&nbsp;&nbsp;fileName</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>原始文件名（即文件在设备端的名称）</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, strong, readonly, nullable) NSString *fileName</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/fileTime" title="fileTime"></a>
	<h3 class="method-title"><code><a href="#//api/name/fileTime">&nbsp;&nbsp;fileTime</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>文件的开始时间（ms）（用于识别是哪个文件）</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) uint64_t fileTime</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/fileSize" title="fileSize"></a>
	<h3 class="method-title"><code><a href="#//api/name/fileSize">&nbsp;&nbsp;fileSize</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>文件总大小（字节）</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) uint32_t fileSize</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/rcvSize" title="rcvSize"></a>
	<h3 class="method-title"><code><a href="#//api/name/rcvSize">&nbsp;&nbsp;rcvSize</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>已下载大小（字节），初始值等于文件偏移量</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readonly) uint32_t rcvSize</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/downloadPlaybackFile:offset:ready:progress:paused:success:failure:" title="downloadPlaybackFile:offset:ready:progress:paused:success:failure:"></a>
	<h3 class="method-title"><code><a href="#//api/name/downloadPlaybackFile:offset:ready:progress:paused:success:failure:">&ndash;&nbsp;downloadPlaybackFile:offset:ready:progress:paused:success:failure:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>开始下载（恢复下载）
此方法内部会自动建立连接，支持断点续传
设备在发送文件完毕后会等待新的下载动作，超过10秒还没有收到任何动作，设备会主动断开连接(20136）。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)downloadPlaybackFile:(uint64_t)<em>fileTime</em> offset:(uint32_t)<em>offset</em> ready:(void ( ^ ) ( uint32_t fileSize ))<em>ready</em> progress:(void ( ^ ) ( NSData *data ))<em>progress</em> paused:(void ( ^ ) ( void ))<em>paused</em> success:(void ( ^ ) ( void ))<em>success</em> failure:(void ( ^ ) ( NSError *error ))<em>failure</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>fileTime</code></th>
						<td><p>要下载的文件的开始时间(ms), 用于识别是哪个文件 @c <code></code>IVPlaybackItem<code>.startTime</code></p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>offset</code></th>
						<td><p>断点续传时填字节偏移量（即当前已下载字节数），重新下载填0</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>ready</code></th>
						<td><p>文件已就绪回调，即将接收数据，<a href="#//api/name/fileSize"><code>fileSize</code></a>:文件总大小</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>progress</code></th>
						<td><p>下载过程回调，可能回调多次，<code>data</code>:文件内容</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>paused</code></th>
						<td><p>下载暂停回调</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>success</code></th>
						<td><p>下载完成回调</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>failure</code></th>
						<td><p>下载失败回调,  @c <a href="../Constants/IVConnError.html"><code>IVConnError</code></a>和<a href="../Constants/IVDownloadError.html"><code>IVDownloadError</code></a></p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<div class="note"><p><strong>Note:</strong> 一台设备同一时间内只能下载一个文件，若要切换下载的文件请先暂停当前下载的文件。</p></div>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/pause" title="pause"></a>
	<h3 class="method-title"><code><a href="#//api/name/pause">&ndash;&nbsp;pause</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>暂停下载
设备将暂停传输，关闭该文件句柄，然后进入10秒倒计时，若期间没有收到任何动作，设备会主动断开连接(20136）</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)pause</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/stop" title="stop"></a>
	<h3 class="method-title"><code><a href="#//api/name/stop">&ndash;&nbsp;stop</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>停止下载，并断开与设备的连接</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)stop</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">IVFileDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2021 tencentcs. All rights reserved. Updated: 2021-07-22</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>